<script setup lang="ts">
import { showNotify } from 'vant'
import { useRouter } from 'vue-router'
const router = useRouter()
const onClickLeft = () => history.back()

const logOut = () => {
   try {
      localStorage.removeItem('token')
      router.push({ name: 'login' })
   } catch (error) {
      return showNotify('退出失败')
   }
}
</script>

<template>
   <div>
      <van-nav-bar :title="$route.meta.title" left-text="返回" left-arrow @click-left="onClickLeft" />
      <van-swipe-cell>
         <van-cell @click="$router.push({ name: 'me.password' })" :border="true" title="修改密码" value="更多>" />
         <van-cell @click="logOut" :border="true" title="退出登录" value="更多>" />
      </van-swipe-cell>
   </div>
</template>

<style lang="scss" scoped></style>
